//
//  YJKeychainTool.m
//  YJB
//
//  Created by YJB on 16/8/23.
//  Copyright © 2016年 YJB. All rights reserved.
//

#import "XFKeychainTool.h"
#import "SAMKeychain.h"

#define tip @"com.htdy.orderSystem"

@implementation XFKeychainTool
+ (void)saveUserName:(NSString *)userName{
    if (![SAMKeychain setPassword:userName forService:tip account:@"username"]){
        [SAMKeychain setPassword:userName forService:tip account:@"username"];
    }
}

+ (NSString *)readUserName{
     return [SAMKeychain passwordForService:tip account:@"username"];
}

+ (void)savePassword:(NSString *)passWord{
    if (![SAMKeychain setPassword:passWord forService:tip account:@"password"]){
        [SAMKeychain setPassword:passWord forService:tip account:@"password"];
    }
}

+ (NSString *)readPassword{
    return [SAMKeychain passwordForService:tip account:@"password"];
}

@end
